﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace DiscoveryLogic.Analytics.Modules.Clusters
{
    class CountToFontSizeConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            const int minFontSize = 6;
            const int maxFontSize = 38;
            const int increment = 3;

            int count = int.Parse(Math.Round((double) value, 0).ToString());

            return ((minFontSize + count*increment) < maxFontSize) ? (minFontSize + count*increment) : maxFontSize;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException("NotImplemented");
        }

        #endregion
    }
}
